package pl.ydp.components.mathcell.mathrecognizer.engine.database.modelsets.math_basic.characters
{
	import pl.ydp.components.mathcell.mathrecognizer.characters.Character;
	import pl.ydp.components.mathcell.mathrecognizer.geometry.classification.PrimitiveType;
	import pl.ydp.components.mathcell.mathrecognizer.model.PrimitivesRelation;
	import pl.ydp.components.mathcell.mathrecognizer.model.RelationDescription;
	import pl.ydp.components.mathcell.mathrecognizer.model.RelationDescriptorType;
	import pl.ydp.components.mathcell.mathrecognizer.model.ShapeModel;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.CrossDescriptior;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.LocationDescriptor;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.SizeDescriptor;
	import pl.ydp.components.mathcell.mathrecognizer.model.presets.PrimitivePresets;
	
	public class MB_ch_pls
	{
		
		public static const MODELS_COUNT:Number = 1;
		
		//---------------------------------------------------
		
		public static function getModels():Array{
			
			var plusShapeModels:Array = new Array();
			
			plusShapeModels.push(getModel0());
			//plusShapeModels.push(getModel1());	
			//plusShapeModels.push(getModel2());		
			
			return plusShapeModels;
		}
		
		//---------------------------------------------------
		
		private static function getModel0():ShapeModel{
			var plus:ShapeModel;
			var name:String = "MB_+_STD";
			var plus_prim:Array = new Array();
			var plus_ref:Array = new Array();
			var plus_rel:Array = new Array();
			
			plus_prim.push(PrimitiveType.LINE2, PrimitiveType.LINE0);
			
			plus_ref.push(0,1,PrimitivePresets.RLT_FULL, 
							PrimitivePresets.RLT_LEFT_QUARTER, PrimitivePresets.RLT_RIGHT_QUARTER, PrimitivePresets.RLT_LOWER_QUARTER, PrimitivePresets.RLT_UPPER_QUARTER);
			
			
			plus_rel.push(new RelationDescription(0,1,new PrimitivesRelation(RelationDescriptorType.CROSS, CrossDescriptior.CROSSING, 10)));
			
			plus_rel.push(new RelationDescription(0,2,new PrimitivesRelation(RelationDescriptorType.SIZE, SizeDescriptor.HEIGHT | SizeDescriptor.ABOUT_15, 7)));
			
			plus_rel.push(new RelationDescription(0,3,new PrimitivesRelation(RelationDescriptorType.LOCATION, LocationDescriptor.OUTSIDE, 10)));
			
			plus_rel.push(new RelationDescription(0,4,new PrimitivesRelation(RelationDescriptorType.LOCATION, LocationDescriptor.OUTSIDE, 10)));
			
			
			plus_rel.push(new RelationDescription(1,2,new PrimitivesRelation(RelationDescriptorType.SIZE, SizeDescriptor.WIDTH | SizeDescriptor.ABOUT_15, 7)));
			
			plus_rel.push(new RelationDescription(1,5,new PrimitivesRelation(RelationDescriptorType.LOCATION, LocationDescriptor.OUTSIDE, 10)));
			
			plus_rel.push(new RelationDescription(1,6,new PrimitivesRelation(RelationDescriptorType.LOCATION, LocationDescriptor.OUTSIDE, 10)));
			
			
			
			plus = new ShapeModel(Character.PLUS, plus_prim, plus_ref, plus_rel, new Array(), name);
			
			return plus;						
		}


	}
}